drop database if exists duckweed_user;
create database duckweed_user default character set utf8mb4 collate utf8mb4_general_ci;

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for capital_account
-- ----------------------------
DROP TABLE IF EXISTS `capital_account`;
CREATE TABLE `capital_account` (
  `id` bigint NOT NULL COMMENT '主键',
  `user_id` bigint NOT NULL COMMENT '用户id',
  `balance` decimal(16,8) NOT NULL COMMENT '余额',
  `frozen` decimal(16,8) DEFAULT NULL COMMENT '冻结',
  `currency` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_croatian_ci NOT NULL COMMENT '币种',
  `create_by` bigint DEFAULT NULL COMMENT '创建人',
  `update_by` bigint DEFAULT NULL COMMENT '修改人',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  `contribution_value` decimal(16,8) NOT NULL COMMENT '贡献值',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_croatian_ci ROW_FORMAT=DYNAMIC COMMENT='资金账户';

-- ----------------------------
-- Records of capital_account
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for currency
-- ----------------------------
DROP TABLE IF EXISTS `currency`;
CREATE TABLE `currency` (
  `id` bigint NOT NULL COMMENT '主键',
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_croatian_ci NOT NULL COMMENT '币种名称',
  `accuracy` int DEFAULT NULL COMMENT '精度',
  `create_by` bigint DEFAULT NULL COMMENT '创建人',
  `update_by` bigint DEFAULT NULL COMMENT '修改人',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  `state` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '1' COMMENT '状态（1：开启，2：禁用）',
  `public_chain` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '公链',
  `service_charge_address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '手续费地址',
  `service_charge_private_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '手续费私钥',
  `service_charge` decimal(32,8) DEFAULT NULL COMMENT '手续费',
  `minimum_recharge_amount` decimal(32,8) DEFAULT NULL COMMENT '最小充值金额',
  `minimum_withdrawal_amount` decimal(32,8) DEFAULT NULL COMMENT '最小提现金额',
  `maximum_withdrawal_amount_per_day` decimal(32,8) DEFAULT NULL COMMENT '单日最大提现金额',
  `confirmation_block_recharge_number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '充值区块确认数',
  `node_address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '节点地址',
  `smart_contract_address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '智能合约地址',
  `api_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'apikey',
  `last_price` decimal(16,8) DEFAULT NULL COMMENT '币种/USDT的最新价格',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_croatian_ci ROW_FORMAT=DYNAMIC COMMENT='币种';

-- ----------------------------
-- Records of currency
-- ----------------------------
BEGIN;
INSERT INTO `currency` VALUES (1, 'USDT', 8, 1, 1, '2022-11-29 17:15:40', '2023-02-10 09:16:48', '1', 'BSC', '0x9af7b92b7019db90d64f4be820bb6ba3b1508036', 'StHlywLjCAW9sUOtVAhnnlipwgv6VjRZt3tyZ2rUl1bF7MrDSdb4jGW5kWUgSDz9UTFyM0l0HfD/FjzysLF/9q+zVgr7NnZXmcEzrnGXjeY=', 0.03000000, 0.10000000, 1.00000000, 1.00000000, '1', 'https://fragrant-responsive-spree.bsc.discover.quiknode.pro/cdc89254abd81a0a44adec5023a93ae81c24ed84/', '0x55d398326f99059fF775485246999027B3197955', NULL, NULL);
INSERT INTO `currency` VALUES (2, 'USDT', 6, 1, 1, '2022-11-29 17:15:40', '2023-04-24 07:56:22', '1', 'TRON', 'TBJ16TAKR2TyF32ejMiSHyT5fMnRBwPmCP', 'cVb615FYLCmoaxnDUF1zvXCZdAr+oQmUyRQeqdtjVb/USa0rYKJaLjKmGZ6Ywrxrqfk6K8NFTDH/WUuLbxFcNA==', 0.03000000, 0.10000000, 1.00000000, 1.00000000, '5', 'https://api.trongrid.io/', 'TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t', NULL, NULL);
COMMIT;

-- ----------------------------
-- Table structure for current_block
-- ----------------------------
DROP TABLE IF EXISTS `current_block`;
CREATE TABLE `current_block` (
  `id` bigint NOT NULL COMMENT '主键ID',
  `create_by` bigint DEFAULT NULL COMMENT '创建人',
  `update_by` bigint DEFAULT NULL COMMENT '修改人',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  `del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '0' COMMENT '逻辑删除',
  `block_number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '当前区块',
  `public_chain` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '公链',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='记录当前区块';

-- ----------------------------
-- Records of current_block
-- ----------------------------
BEGIN;
INSERT INTO `current_block` VALUES (1563162101978083330, NULL, NULL, '2022-08-26 21:51:01', '2022-12-26 12:04:31', '0', '2126635', 'USC');
INSERT INTO `current_block` VALUES (1606123856470401024, NULL, NULL, '2022-12-23 11:05:42', '2023-04-24 07:07:42', '0', '49222073', 'TRON');
INSERT INTO `current_block` VALUES (1622165822317228032, NULL, NULL, '2023-02-05 17:30:45', '2023-03-08 06:12:09', '0', '26279310', 'BSC');
COMMIT;

-- ----------------------------
-- Table structure for finance_fuel
-- ----------------------------
DROP TABLE IF EXISTS `finance_fuel`;
CREATE TABLE `finance_fuel` (
  `id` bigint NOT NULL COMMENT '主键',
  `buy_fuel_id` bigint DEFAULT NULL COMMENT '购买燃料包id',
  `finance_record_id` bigint DEFAULT NULL COMMENT '分配记录id',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 ROW_FORMAT=DYNAMIC COMMENT='分配燃料表';

-- ----------------------------
-- Records of finance_fuel
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for finance_record
-- ----------------------------
DROP TABLE IF EXISTS `finance_record`;
CREATE TABLE `finance_record` (
  `id` bigint NOT NULL COMMENT '主键',
  `type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '分配类型  0 保证金 1 平台  2 市场',
  `quantity` decimal(16,8) DEFAULT NULL COMMENT '分配数量',
  `status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '分配状态  0 进行中  1 已完成 2 已失败',
  `hash` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '交易哈希',
  `create_by` bigint DEFAULT NULL COMMENT '创建人',
  `update_by` bigint DEFAULT NULL COMMENT '修改人',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  `chain` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '链',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='财务记录';

-- ----------------------------
-- Records of finance_record
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for fuel_account
-- ----------------------------
DROP TABLE IF EXISTS `fuel_account`;
CREATE TABLE `fuel_account` (
  `id` bigint NOT NULL COMMENT '主键',
  `user_id` bigint NOT NULL COMMENT '用户id',
  `balance` decimal(16,8) DEFAULT NULL COMMENT '余额',
  `frozen` decimal(16,8) DEFAULT NULL COMMENT '冻结',
  `currency` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_croatian_ci NOT NULL COMMENT '币种',
  `create_by` bigint DEFAULT NULL COMMENT '创建人',
  `update_by` bigint DEFAULT NULL COMMENT '修改人',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_croatian_ci ROW_FORMAT=DYNAMIC COMMENT='燃料账户';

-- ----------------------------
-- Records of fuel_account
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for fuel_consume
-- ----------------------------
DROP TABLE IF EXISTS `fuel_consume`;
CREATE TABLE `fuel_consume` (
  `id` bigint NOT NULL COMMENT '主键',
  `fuel_quantity` decimal(16,8) NOT NULL COMMENT '消耗的燃油数量',
  `type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_croatian_ci NOT NULL COMMENT '产生燃料的类型',
  `user_id` bigint NOT NULL COMMENT '用户id',
  `create_by` bigint DEFAULT NULL COMMENT '创建人',
  `update_by` bigint DEFAULT NULL COMMENT '修改人',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  `distribution_quantity` decimal(16,8) DEFAULT NULL COMMENT '实际分红的燃油总数',
  `strategy_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_croatian_ci DEFAULT NULL COMMENT '策略',
  `order_id` bigint DEFAULT NULL COMMENT '订单id',
  `gross_profit` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_croatian_ci DEFAULT NULL COMMENT '毛利润',
  `net_profit` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_croatian_ci DEFAULT NULL COMMENT '净利润',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_croatian_ci ROW_FORMAT=DYNAMIC COMMENT='燃料消耗记录';

-- ----------------------------
-- Records of fuel_consume
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for fuel_receive_dividends
-- ----------------------------
DROP TABLE IF EXISTS `fuel_receive_dividends`;
CREATE TABLE `fuel_receive_dividends` (
  `id` bigint NOT NULL COMMENT '主键',
  `fuel_consume_id` bigint NOT NULL COMMENT '燃油产生记录id',
  `fuel_quantity` decimal(16,8) NOT NULL COMMENT '分红的燃油数量',
  `fuel_proportion` decimal(16,8) NOT NULL COMMENT '分红比例',
  `type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_croatian_ci NOT NULL COMMENT '分红类型',
  `user_id` bigint DEFAULT NULL COMMENT '收益人',
  `create_by` bigint DEFAULT NULL COMMENT '创建人',
  `update_by` bigint DEFAULT NULL COMMENT '修改人',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  `is_success` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_croatian_ci DEFAULT NULL COMMENT '是否已结算 0 否 1 是',
  `order_id` bigint DEFAULT NULL COMMENT '订单id'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_croatian_ci ROW_FORMAT=DYNAMIC COMMENT='燃料分红明细';

-- ----------------------------
-- Records of fuel_receive_dividends
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for fuel_set_meal
-- ----------------------------
DROP TABLE IF EXISTS `fuel_set_meal`;
CREATE TABLE `fuel_set_meal` (
  `id` bigint NOT NULL COMMENT '主键',
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '套餐名称',
  `capital_price` decimal(16,2) DEFAULT NULL COMMENT '资金价格',
  `fuel_quantity` decimal(16,2) DEFAULT NULL COMMENT '燃料数量',
  `status` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '是否启用  0 否 1 是',
  `create_by` bigint DEFAULT NULL COMMENT '创建人',
  `update_by` bigint DEFAULT NULL COMMENT '修改人',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  `contribution_value` decimal(16,8) NOT NULL COMMENT '贡献值',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='燃料套餐';

-- ----------------------------
-- Records of fuel_set_meal
-- ----------------------------
BEGIN;
INSERT INTO `fuel_set_meal` VALUES (0, '200套餐', 200.00, 200.00, '1', 1595309447372836865, 1595309447372836865, '2022-12-26 12:20:24', '2023-02-05 17:12:31', 2000.00000000);
INSERT INTO `fuel_set_meal` VALUES (1, '500套餐', 500.00, 500.00, '1', 1595309447372836865, 1595309447372836865, '2022-12-26 12:23:43', '2023-02-05 17:12:34', 5000.00000000);
INSERT INTO `fuel_set_meal` VALUES (3, '1000套餐', 1000.00, 1000.00, '1', 1595309447372836865, 1595309447372836865, '2022-12-26 12:23:43', '2023-02-05 17:12:39', 10000.00000000);
INSERT INTO `fuel_set_meal` VALUES (1613165617034952704, '4000套餐', 4000.00, 4000.00, '1', 1595309447372836865, 1595309447372836865, '2022-12-26 12:23:43', '2023-02-05 17:12:42', 40000.00000000);
INSERT INTO `fuel_set_meal` VALUES (1623512573543591936, '自定义燃料套餐', 1.00, 0.00, '1', 1595309447372836865, 1595309447372836865, '2023-02-09 10:42:16', '2023-02-09 10:42:16', 10.00000000);
COMMIT;

-- ----------------------------
-- Table structure for imputation_record
-- ----------------------------
DROP TABLE IF EXISTS `imputation_record`;
CREATE TABLE `imputation_record` (
  `id` bigint NOT NULL COMMENT '主键ID',
  `create_by` bigint DEFAULT NULL COMMENT '创建人',
  `update_by` bigint DEFAULT NULL COMMENT '修改人',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  `del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '0' COMMENT '逻辑删除',
  `account_id` bigint DEFAULT NULL COMMENT '账户id',
  `source_address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '来源地址',
  `arrival_address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '到账地址',
  `transaction_hash` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '交易哈希',
  `state` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '状态（1：归集中，2：成功，3：失败）',
  `quantity` decimal(32,8) DEFAULT NULL COMMENT '数量',
  `currency` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '币种',
  `chain` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '公链',
  `notionalpooling_id` bigint DEFAULT NULL COMMENT '归集id',
  `user_id` bigint DEFAULT NULL COMMENT '用户ID',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='归集列表';

-- ----------------------------
-- Records of imputation_record
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for recharge_record
-- ----------------------------
DROP TABLE IF EXISTS `recharge_record`;
CREATE TABLE `recharge_record` (
  `id` bigint NOT NULL COMMENT '主键ID',
  `create_by` bigint DEFAULT NULL COMMENT '创建人',
  `update_by` bigint DEFAULT NULL COMMENT '修改人',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  `del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '0' COMMENT '逻辑删除',
  `transaction_hash` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '交易哈希',
  `source_address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '来源地址',
  `arrival_address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '到账地址',
  `quantity` decimal(32,8) DEFAULT NULL COMMENT '数量',
  `block_number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '区块高度',
  `block_confirmation_number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '区块确认数',
  `state` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '状态（1：充值中，2：已完成，3：已失败）',
  `address_id` bigint DEFAULT NULL COMMENT '账户地址id',
  `minimum_recharge_number` decimal(32,8) DEFAULT NULL COMMENT '最小充值数',
  `block_confirmation_recharge_number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '充值区块确认数',
  `user_id` bigint DEFAULT NULL COMMENT '用户ID',
  `public_chain` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '公链',
  `currency` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '币种',
  `type` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '充值类型（系统字典：user_fund_recharge_type）',
  `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '备注',
  `service_charge` decimal(32,8) DEFAULT NULL COMMENT '手续费',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='充值记录';

-- ----------------------------
-- Records of recharge_record
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for timing_config
-- ----------------------------
DROP TABLE IF EXISTS `timing_config`;
CREATE TABLE `timing_config` (
  `id` bigint NOT NULL COMMENT '主键',
  `type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_croatian_ci NOT NULL COMMENT '类型 ( 0 手续费 1 归集 2 保证金 3 黑洞 4 客户冷钱包 )',
  `address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_croatian_ci NOT NULL COMMENT '地址',
  `private_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_croatian_ci DEFAULT NULL COMMENT '私钥',
  `timing_period` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_croatian_ci DEFAULT NULL COMMENT '定时周期',
  `to_wallet_proportion` decimal(16,8) DEFAULT NULL COMMENT '打入客户冷钱包的比例',
  `status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_croatian_ci DEFAULT NULL COMMENT '任务是否启用 0 否 1 是',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_croatian_ci ROW_FORMAT=DYNAMIC COMMENT='归集相关定时任务配置';

-- ----------------------------
-- Records of timing_config
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for timing_implement_record
-- ----------------------------
DROP TABLE IF EXISTS `timing_implement_record`;
CREATE TABLE `timing_implement_record` (
  `id` bigint NOT NULL COMMENT '主键',
  `type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_croatian_ci DEFAULT NULL COMMENT '类型 ( 0 归集  1 保证金  2 黑洞  3 客户冷钱包 )',
  `status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_croatian_ci DEFAULT NULL COMMENT '执行结果 ( 0 进行中 1 成功 2 失败 )',
  `source_address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '来源地址',
  `arrival_address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '到账地址',
  `transaction_hash` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '交易哈希',
  `quantity` decimal(32,8) DEFAULT NULL COMMENT '数量',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_croatian_ci ROW_FORMAT=DYNAMIC COMMENT='归集相关定时任务执行记录';

-- ----------------------------
-- Records of timing_implement_record
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for transfer_detailed
-- ----------------------------
DROP TABLE IF EXISTS `transfer_detailed`;
CREATE TABLE `transfer_detailed` (
  `id` bigint NOT NULL COMMENT '主键',
  `user_id` bigint NOT NULL COMMENT '用户id',
  `quantity` decimal(32,8) NOT NULL COMMENT '数量',
  `currency` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_croatian_ci NOT NULL COMMENT '币种',
  `type` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_croatian_ci NOT NULL COMMENT '操作类型( 0 资金转燃料  1 燃料转资金 )',
  `create_by` bigint DEFAULT NULL COMMENT '创建人',
  `update_by` bigint DEFAULT NULL COMMENT '修改人',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  `to_user_id` bigint DEFAULT NULL COMMENT '目标id',
  `fuel_set_meal_id` bigint DEFAULT NULL COMMENT '燃料套餐',
  `contribution_value` decimal(16,8) NOT NULL COMMENT '贡献值',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_croatian_ci ROW_FORMAT=DYNAMIC COMMENT='划转记录i';

-- ----------------------------
-- Records of transfer_detailed
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for undo_log
-- ----------------------------
DROP TABLE IF EXISTS `undo_log`;
CREATE TABLE `undo_log` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `branch_id` bigint NOT NULL,
  `xid` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `context` varchar(128) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `rollback_info` longblob NOT NULL,
  `log_status` int NOT NULL,
  `log_created` datetime NOT NULL,
  `log_modified` datetime NOT NULL,
  `ext` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `ux_undo_log` (`xid`,`branch_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of undo_log
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for user
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
  `id` bigint NOT NULL COMMENT '主键',
  `parent_id` bigint DEFAULT NULL COMMENT '父级id',
  `email` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_croatian_ci DEFAULT NULL COMMENT '邮箱',
  `user_name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_croatian_ci DEFAULT NULL COMMENT '用户名',
  `password` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_croatian_ci DEFAULT NULL COMMENT '密码',
  `level` int NOT NULL DEFAULT '0' COMMENT '用户等级(0 普通用户 1 一级节点 2 二级节点 3 三级节点 4 超级节点)',
  `is_disable_level` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_croatian_ci NOT NULL DEFAULT '0' COMMENT '是否禁用节点( 0 否 1 是)',
  `is_activation` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_croatian_ci NOT NULL DEFAULT '0' COMMENT '是否激活 ( 0 否 1 是 )',
  `head_portrait` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_croatian_ci DEFAULT NULL COMMENT '头像',
  `direct_invitation_count` int NOT NULL DEFAULT '0' COMMENT '直接邀请人数',
  `indirect_invitation_count` int NOT NULL DEFAULT '0' COMMENT '间接邀请人数',
  `community_count` int NOT NULL DEFAULT '0' COMMENT '社区人数',
  `achievement_quantity` decimal(32,8) DEFAULT NULL COMMENT '伞下用户总燃料消耗业绩(UNT)',
  `invitation_code` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_croatian_ci DEFAULT NULL COMMENT '邀请码',
  `create_by` bigint DEFAULT NULL COMMENT '创建人',
  `update_by` bigint DEFAULT NULL COMMENT '修改人',
  `create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  `chain` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '授权公链',
  `address` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT '授权地址',
  `is_confrim_risk` varchar(1) CHARACTER SET utf8mb3 COLLATE utf8mb3_croatian_ci NOT NULL DEFAULT '0' COMMENT '是否确认风险告知 0否 1是',
  `community_fuel_recharge` decimal(16,8) DEFAULT NULL COMMENT '伞下总购买燃料包数量',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_croatian_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of user
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for user_address
-- ----------------------------
DROP TABLE IF EXISTS `user_address`;
CREATE TABLE `user_address` (
  `id` bigint NOT NULL COMMENT '主键',
  `user_id` bigint NOT NULL COMMENT '用户id',
  `address` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_croatian_ci NOT NULL COMMENT '地址',
  `chain` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_croatian_ci NOT NULL COMMENT '公链',
  `private_key` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_croatian_ci NOT NULL COMMENT '私钥',
  `create_by` bigint DEFAULT NULL COMMENT '创建人',
  `update_by` bigint DEFAULT NULL COMMENT '修改人',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  `public_private_key` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_croatian_ci DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_croatian_ci ROW_FORMAT=DYNAMIC COMMENT='用户地址';

-- ----------------------------
-- Records of user_address
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for user_agreement
-- ----------------------------
DROP TABLE IF EXISTS `user_agreement`;
CREATE TABLE `user_agreement` (
  `id` bigint NOT NULL COMMENT '主键',
  `user_id` bigint DEFAULT NULL COMMENT '用户id',
  `agreement_image` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '合同图片',
  `create_by` bigint DEFAULT NULL COMMENT '创建人',
  `update_by` bigint DEFAULT NULL COMMENT '修改人',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='用户合同签订';

-- ----------------------------
-- Records of user_agreement
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for user_api
-- ----------------------------
DROP TABLE IF EXISTS `user_api`;
CREATE TABLE `user_api` (
  `id` bigint NOT NULL COMMENT '主键',
  `user_id` bigint NOT NULL COMMENT '用户id',
  `api_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_croatian_ci DEFAULT NULL COMMENT 'api - key',
  `secret_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_croatian_ci DEFAULT NULL COMMENT 'secret - key',
  `password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_croatian_ci DEFAULT NULL COMMENT '密码',
  `platform_id` bigint DEFAULT NULL COMMENT '平台id',
  `create_by` bigint DEFAULT NULL COMMENT '创建人',
  `update_by` bigint DEFAULT NULL COMMENT '修改人',
  `create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_croatian_ci ROW_FORMAT=DYNAMIC COMMENT='用户 api 表';

-- ----------------------------
-- Records of user_api
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for withdrawal_record
-- ----------------------------
DROP TABLE IF EXISTS `withdrawal_record`;
CREATE TABLE `withdrawal_record` (
  `id` bigint NOT NULL COMMENT '主键',
  `create_by` bigint DEFAULT NULL COMMENT '创建人',
  `update_by` bigint DEFAULT NULL COMMENT '修改人',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  `del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '0' COMMENT '逻辑删除',
  `account_id` bigint DEFAULT NULL COMMENT '账户id',
  `source_address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '来源地址',
  `arrival_address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '到账地址',
  `transaction_hash` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '交易哈希',
  `state` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '状态（1：审核中，2：提现中，3：已完成，4：已拒绝，5：已失败）',
  `quantity` decimal(32,8) DEFAULT NULL COMMENT '数量',
  `service_charge` decimal(32,8) DEFAULT NULL COMMENT '手续费',
  `actual_withdrawal_amount` decimal(32,8) DEFAULT NULL COMMENT '实际提现金额',
  `user_id` bigint DEFAULT NULL COMMENT '用户ID',
  `public_chain` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '公链',
  `currency` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '币种',
  `remarks` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '审核备注',
  `type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_croatian_ci DEFAULT NULL COMMENT '提现类型  0 充值提现 1 奖励提现',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_croatian_ci ROW_FORMAT=DYNAMIC COMMENT='提现记录';

-- ----------------------------
-- Records of withdrawal_record
-- ----------------------------
BEGIN;
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
